Merge branch 'master' into code-agent

Umar M. Sheikh 11 years ago
parent
commit
2188f3a72e

+ 2 - 0
Gemfile

@@ -46,6 +46,8 @@ end
46 46
 
47 47
 group :development do
48 48
   gem 'pry'
49
+  gem 'binding_of_caller'
50
+  gem 'better_errors'
49 51
 end
50 52
 
51 53
 group :development, :test do

+ 8 - 0
Gemfile.lock

@@ -31,6 +31,11 @@ GEM
31 31
     addressable (2.3.5)
32 32
     arel (3.0.3)
33 33
     bcrypt-ruby (3.1.1)
34
+    better_errors (1.1.0)
35
+      coderay (>= 1.0.0)
36
+      erubis (>= 2.6.6)
37
+    binding_of_caller (0.7.2)
38
+      debug_inspector (>= 0.0.1)
34 39
     bootstrap-kaminari-views (0.0.2)
35 40
       kaminari (>= 0.13)
36 41
       rails (>= 3.1)
@@ -53,6 +58,7 @@ GEM
53 58
     crack (0.4.1)
54 59
       safe_yaml (~> 0.9.0)
55 60
     daemons (1.1.9)
61
+    debug_inspector (0.0.2)
56 62
     delayed_job (4.0.0)
57 63
       activesupport (>= 3.0, < 4.1)
58 64
     delayed_job_active_record (4.0.0)
@@ -266,6 +272,8 @@ PLATFORMS
266 272
   ruby
267 273
 
268 274
 DEPENDENCIES
275
+  better_errors
276
+  binding_of_caller
269 277
   bootstrap-kaminari-views
270 278
   coffee-rails (~> 3.2.1)
271 279
   coveralls

+ 1 - 1
app/views/agents/agent_views/peak_detector_agent/_show.html.erb

@@ -3,7 +3,7 @@
3 3
 <% end %>
4 4
 
5 5
 <% if @agent.memory[:data] && @agent.memory[:data].length > 0 %>
6
-  <h3>Recent Tweet Trends</h3>
6
+  <h3>Recent Trends</h3>
7 7
   <% @agent.memory[:data].each.with_index do |(group_name, data), index| %>
8 8
     <div class="filter-group counts">
9 9
       <div class='filter'><%= link_to group_name.to_s, "https://twitter.com/search?q=#{CGI::escape group_name.to_s}", :target => "blank" %></div>

+ 19 - 0
db/migrate/20140127164931_change_handler_to_medium_text.rb

@@ -0,0 +1,19 @@
1
+# Increase handler size to 16MB (consistent with events.payload)
2
+
3
+class ChangeHandlerToMediumText < ActiveRecord::Migration
4
+  def up
5
+    if mysql?
6
+      change_column :delayed_jobs, :handler, :text, :limit => 16777215
7
+    end
8
+  end
9
+
10
+  def down
11
+    if mysql?
12
+      change_column :delayed_jobs, :handler, :text, :limit => 65535
13
+    end
14
+  end
15
+
16
+  def mysql?
17
+    ActiveRecord::Base.connection.adapter_name =~ /mysql/i
18
+  end
19
+end

+ 1 - 14
db/schema.rb

@@ -37,9 +37,9 @@ ActiveRecord::Schema.define(:version => 20131227000021) do
37 37
     t.datetime "updated_at",                                                 :null => false
38 38
     t.text     "memory",                :limit => 2147483647
39 39
     t.datetime "last_webhook_at"
40
+    t.integer  "keep_events_for",                             :default => 0, :null => false
40 41
     t.datetime "last_event_at"
41 42
     t.datetime "last_error_log_at"
42
-    t.integer  "keep_events_for",                             :default => 0, :null => false
43 43
   end
44 44
 
45 45
   add_index "agents", ["schedule"], :name => "index_agents_on_schedule"
@@ -87,19 +87,6 @@ ActiveRecord::Schema.define(:version => 20131227000021) do
87 87
   add_index "links", ["receiver_id", "source_id"], :name => "index_links_on_receiver_id_and_source_id"
88 88
   add_index "links", ["source_id", "receiver_id"], :name => "index_links_on_source_id_and_receiver_id"
89 89
 
90
-  create_table "rails_admin_histories", :force => true do |t|
91
-    t.text     "message"
92
-    t.string   "username"
93
-    t.integer  "item"
94
-    t.string   "table"
95
-    t.integer  "month",      :limit => 2
96
-    t.integer  "year",       :limit => 8
97
-    t.datetime "created_at",              :null => false
98
-    t.datetime "updated_at",              :null => false
99
-  end
100
-
101
-  add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories"
102
-
103 90
   create_table "users", :force => true do |t|
104 91
     t.string   "email",                  :default => "",    :null => false
105 92
     t.string   "encrypted_password",     :default => "",    :null => false